Grids: split dataController _setPagingOptions into paging utils - #34669
Merged
anna-shakhova merged 3 commits intoAug 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors GridCore’s DataController paging option application by extracting the paging reconciliation logic into dedicated utilities, improving testability and type-safety around scrolling-mode-derived paging behavior.
Changes:
- Extracted paging reconciliation into
resolvePaginate/syncPagingutilities and replaced_setPagingOptionswithapplyPagingOptions. - Improved grid option typing so
scrolling.modecan be accessed without suppressions in the pager view. - Migrated/added Jest coverage for paging option application, including the T677650 regression scenario.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js | Removes a QUnit regression test that is now covered via Jest in the internal grid tests. |
| packages/devextreme/js/__internal/grids/grid_core/pager/m_pager.ts | Drops a TS suppression now that scrolling.mode is properly typed. |
| packages/devextreme/js/__internal/grids/grid_core/m_types.ts | Extends internal grid option typing to include scrolling with a typed mode. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/paging.ts | Introduces reusable paging utilities (resolvePaginate, syncPaging). |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/tests/paging.test.ts | Adds focused unit tests for paging utility behavior and ordering guarantees. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/types.ts | Adds shared paging-related types used by the controller and utilities. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/data_controller.ts | Replaces inline paging option sync with applyPagingOptions + utilities; keeps behavior around reload/pageChanged. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/tests/data_controller.paging.test.ts | Adds controller-level paging behavior tests, including no-op option updates and scrolling-derived behavior. |
anna-shakhova
force-pushed
the
data_set_paging_options_refactor_main
branch
from
August 6, 2026 07:01
7462041 to
78700fc
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/paging.ts:31
syncPagingcomparesdataSource.pageSize()to the targetpageSizeeven when paginate is off. For aDataSourceAdapter,pageSize()returns0in this state (seegrid_core/data_source_adapter/m_data_source_adapter.ts), soisPageSizeChangedcan becometrueeven when the underlying DataSource already has the same page size. That can makehasChangesflip totrueand trigger unnecessary reloads on paging option updates while paging is disabled.
Consider comparing against the wrapped raw DataSource pageSize when available (or otherwise avoiding change detection based on the adapter’s 0 sentinel).
// Must be compared after dataSource.paginate: while paginate is off,
// the adapter's pageSize() reports 0 rather than the real page size.
const isPageSizeChanged = pageSize !== undefined && dataSource.pageSize() !== pageSize;
bit-byte0
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.